﻿using Autofac.Core;

using Azure.Identity;

using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Primitives;

using PLCS.SocialHttpApi.WebServiceControllers;

using SoapCore;
using SoapCore.Extensibility;
using SoapCore.ServiceModel;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Security;
using System.ServiceModel.Channels;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace PLCS.SocialHttpApi
{
    public class LogOperationTuner : IServiceOperationTuner
    {
        public void Tune(HttpContext httpContext, object serviceInstance, SoapCore.ServiceModel.OperationDescription operation)
        {
            if (operation.Name.Equals("WebServiceExampleService"))
            {
                var service = serviceInstance as WebServiceExample;
                string result = string.Empty;

                StringValues paramValue;
                if (httpContext.Request.Headers.TryGetValue("REPSERNO", out paramValue))
                {
                    result = paramValue[0];
                }
            }
        }
    }
}